

<head> 
     <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
      <title>重复名生成</title>
      <style>
        /*  *{background:#FF3D58;color:#FFDDAC}*/
          h1{
           box-shadow: 2px 2px 2px #909090;width:104%;
margin:0px 0px 30px -7px;}
           .button
            {
        border-radius:11px;
        border:1.5px solid #636363;
        display:inline-block;
        padding:1px 5px 1px 5px;
        font-size:17px;
            }
            input[type=text]{
        border-radius:11px;
        border:1.5px solid #636363;
        display:inline-block;
        height:24px;
        font-size:17px;
        width:170px;
            }
            .toast{
                display:none;
                position:fixed;
                top:70%;
                left:50%;
                transform:translate(-50%, -50%);
                background:#A7A7A7;
                padding:17px 17px 17px 17px;
                border-radius:20px;
                color:white;
                }
           </style>
</head>
<h1>重复名生成</h1>
<!--h2 style=color:#FFDDAC>春节快乐！</h2-->
<div align=center>
输入名字:<input id=name type=text>&nbsp;&nbsp;<div onclick=s() class=button>生成</div><br>
生成结果:<input id=result type=text>&nbsp;&nbsp;<div onclick=copy() class=button>复制</div>
<br>
<label><input type=radio name=system id=android checked=checked>安卓</label>
<label><input type=radio name=system id=iOS>苹果</label>
</div>
<br>
<br>
<div align=center style=background:/*#FF3D58;*/f9f9f9;width:100%;position:fixed;right:0px;bottom:0px;>
<strong>tip:</strong>&nbsp;
如仍然重复，可再次点击按钮生成<br>名字字数越少越不易重复<br>不输入直接生成即为空白名<br>
by:QQ2655995367（有bug可留言）
</div>
<div class=toast id=toast></div>
<script>
function dom(x){
return document.getElementById(x)
}
function r(minNum,maxNum){ 
    switch(arguments.length){ 
        case 1: 
            return parseInt(Math.random()*minNum+1,10); 
        break; 
        case 2: 
            return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10); 
        break; 
            default: 
                return 0; 
            break; 
    } 
} 
var timeout;
function toast(str)
{
    clearTimeout(timeout)
    dom("toast").style.display="block"
    dom("toast").innerHTML=str
    timeout=setTimeout('dom("toast").style.display="none"',1500)
}

function s()
{
if(dom("android").checked){
var i=1
var blank="%E2%81%A"
var n=[...dom("name").value]
if(dom("name").value=="")
{n=[""]}
if(n.length>=6)
{alert("名字字数超限制，可能无法使用，请减小至6字符以下")
}
else
{
i=6-n.length
}
var m=0
while(m<i)
{m++
var rr=r(0,15)
if(rr==1)
{rr=0}
n[r(0,n.length-1)]+=blank+rr.toString(16)
console.log(n)
}
if(m==i)
{
dom("result").value=decodeURI(n.join(""))
toast("已生成重复名，点击复制可使用")
}
}else{
var i=1
var blank=["%E2%81%A0","%7F","%E2%81%A3","%E2%81%A2"]
var n=[...dom("name").value]
if(dom("name").value=="")
{n=[""]}
if(n.length>=6)
{alert("名字字数超限制，可能无法使用，请减小至6字符以下")
}
else
{
i=6-n.length
}
var m=0
while(m<i)
{m++
var rr=r(0,3)
n[r(0,n.length-1)]+=blank[rr]
console.log(n)
}
if(m==i)
{
dom("result").value=decodeURI(n.join(""))
toast("已生成重复名，点击复制可使用")
}
}
}
function copy()
{
var fz=dom("result");
fz.select();
document.execCommand("Copy");
    toast("复制成功！")

}
</script>